package com.tedu.egmybatis1.work;

import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface IProduct {
    @Insert("insert into product(title,price,stock) values(#{title},#{price},#{stock})")
    int insert(Product product);
    @Delete("delete from product where id=#{id}")
    int deleteById(Integer id);
    @Update("update product set  title=#{title},price=#{price},stock=#{stock} where id=#{id}")
    int update(Product product);
    @Select("select id,title,price,stock from product ")
    List<Product> selectAll(Product product);

}
